﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Library;

namespace Sport_Shop
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        static DataTable tbGioHang = new DataTable();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                load_Menu();
                //LoadCountItem();
                
            }
        }

        private void load_Menu()
        {
            DataAccess da = new DataAccess();
            string sql = "SELECT MaLoai, TenLoai FROM LoaiSanPham";
            rpMenuSP.DataSource = da.GetDataTable(sql);
            rpMenuSP.DataBind();
        }

        protected void btTimkiem_Click(object sender, EventArgs e)
        {
            if (tbTim.Text != null)
            {
                Response.Redirect("~/KQTim.aspx?TenSP=" + tbTim.Text.ToString());
            }
        }

        //void LoadCountItem()
        //{
        //    DataTable dtCart = Session["GioHang"] as DataTable;

        //    lbCount.Text = dtCart.Compute("SUM(SoLuong)", "").ToString() + " item(s)";

        //}

        
    }
}